package org.linlinjava.litemall.brand.util;

import javax.servlet.http.HttpSession;
import java.util.HashMap;

public class MySessionContext {
    private static HashMap map = new HashMap();
    public static synchronized void AddSession(HttpSession session) {
        if (session != null) {
            map.put(session.getId(), session);
        }
    }
    public static synchronized void DelSession(HttpSession session) {
        if (session != null) {
            map.remove(session.getId());
        }
    }
    public static synchronized HttpSession getSession(String sessionId) {
        if (sessionId == null) {
            return null;
        }
        return (HttpSession) map.get(sessionId);
    }
}
